package cn.tedu.mybatisdemo.mapper;

import cn.tedu.mybatisdemo.pojo.Student;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface StudentMapper {

    //@Select("SELECT * FROM student")
    public List<Student> getStudentAll();

    //1.插入一条数据进 Student表
    public int insertStudent();
    //2.修改一下你加入Student表中的这条数据  条件式通过名字修改
    public int updateStudent();
    //3.删除你刚刚加入的数据  条件式通过名字删除
    public int deleteStudent();

    //根据Id获取学生信息
    public Student getStudentById(Integer id);

    public Student getStudentByName(String name);

    public List<Student> selectByIds(@Param("minId") Integer minId, @Param("maxId") Integer maxId);

    public Integer addStudent(Student student);
}

